#include <iostream>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>

using namespace std;

void myhandler(int signo)
{
    printf("get a signo: %d\n", signo);
}

int main()
{
    signal(6, myhandler);   

    int cnt = 0;
    while (1)
    {
        printf("I am a process, pid: %d\n", getpid());
        if (cnt % 2 == 0)
        {
            abort();
        }
        cnt++;
        sleep(1);
    }
    return 0;
}